'use strict';
module.exports = {
	/**
	 * 删除推广
	 * @url admin/popularize/sys/delete 前端调用的url参数地址
	 * data 请求参数 说明
	 * @param {String} _id  ID
	 */
	main: async (event) => {
		let { data = {}, userInfo, util, filterResponse, originalParam } = event;
		let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
		let { uid } = data;
		let res = { code: 0, msg: "" };
		// 业务逻辑开始-----------------------------------------------------------
		let { _id } = data;
		
		if (vk.pubfn.isNull(_id)) {
			return { code: -1, msg: '_id不能为空' };
		}
		
		let dbName = "db-popularize"
		
		// 执行数据库API请求
		res.num = await vk.baseDao.deleteById({
			dbName,
			id:_id
		});
		// 业务逻辑结束-----------------------------------------------------------
		return res;
	}
}
